package com.lyf.scm.admin.domain.remote.allocationservice;

import com.github.pagehelper.PageInfo;
import com.lyf.scm.admin.api.dto.GmvTargetDTO;
import com.lyf.scm.admin.api.dto.GmvTargetInfoDTO;
import com.rome.arch.core.clientobject.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * description:
 *
 * @author: haodong
 * @data: 2020/7/8 16:38
 */
@FeignClient(name = "scm-plan-service")
public interface GmvTargetRemote {

    /**
     * 按条件查询gmv指标(天)
     *
     * @param gmvTarget
     * @return
     */
    @PostMapping("/api/v1/gmvTarget/list")
    Response<PageInfo<GmvTargetInfoDTO>> listBySelective(@RequestBody GmvTargetDTO gmvTarget);

    /**
     * 查询全渠道gmv指标(范围)
     *
     * @param gmvTarget
     * @return
     */
    @PostMapping("/api/v1/gmvTarget/listAll")
    Response<List<GmvTargetInfoDTO>> listAllBySelective(@RequestBody GmvTargetDTO gmvTarget);

    /**
     * 批量新增
     *
     * @param gmvTargetList
     * @return
     */
    @PostMapping("/api/v1/gmvTarget/batchSave")
    Response<Boolean> batchSave(@RequestBody List<GmvTargetDTO> gmvTargetList);

    @PostMapping(value = "/api/v1/gmvTarget/export", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    feign.Response exportExcel(@RequestBody GmvTargetDTO gmvTargetDTO, @RequestParam("type") Integer type);

    /**
     * 更新销售额目标
     * @param gmvTarget
     * @return
     */
    @PostMapping(value = "/api/v1/gmvTarget/updateTarget")
    Response<Boolean> updateTarget(@RequestBody List<GmvTargetDTO> gmvTarget);

    /**
     * 删除对应标识的数据
     *
     * @param opSign
     * @return
     */
    @PostMapping("/api/v1/gmvTarget/delete")
    Response delete(@RequestParam("opSign") String opSign);
}
